package com.wushijia.designpatterns.observer.jdk;

import com.wushijia.designpatterns.observer.bug.LotteryResult;
import com.wushijia.designpatterns.observer.bug.MinibusTargetService;
import java.util.Date;

public class EventManagerObservableImpl extends EventManagerObservable {

  private final MinibusTargetService minibusTargetService = new MinibusTargetService();

  @Override
  protected LotteryResult doDraw(String uid) {
    // 摇号
    String lottery = minibusTargetService.lottery(uid);
    // 结果
    return new LotteryResult(uid, lottery, new Date());
  }
}
